package cate.game.play.skill.passive.talent;

import cate.common.table.d.GDSkill;
import cate.common.util.XT;
import cate.game.play.config.PlayCfgArgs;
import cate.game.play.proce.action.ctx.SkillActionCtx;
import cate.game.play.skill.effect.SkillEffect;
import cate.game.play.skill.passive.PassiveHandler;

/**
 * 使用治疗技能时，有35%的概率恢复1.4倍治疗量
 */
public class 神疗PH extends PassiveHandler {

	private int 概率;

	private double 额外系数;


	//概率=3500&额外系数=4000
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		概率 = args.getInt("概率", 0);
		额外系数 = args.getWDouble("额外系数",0d);
	}

	@Override
	public void afterSelectTargets(SkillActionCtx action, SkillEffect effect) {
		if(!action.getSkill().cfg.isEffectType(GDSkill.EffectType.治疗)){
			return;
		}
		if(!XT.chance(概率)){
			return;
		}
		effect.addHpChangeRate(额外系数);
	}
}
